<template>
  <div>
    <LoginHeader title="欢迎登录">
      <a>登录页面，调查问卷 </a>
    </LoginHeader>
    <!-- 登录 -->
    <div class="login-wrap">
      <div class="login">
        <div class="loginform">
          <ul class="tab clearFix">
            <li>
              <a
                :class="isAccount ? 'current' : ''"
                @click.prevent="switchTab(1)"
                >账户登录</a
              >
            </li>
            <li>
              <a
                :class="!isAccount ? 'current' : ''"
                @click.prevent="switchTab(2)"
                >扫码登录</a
              >
            </li>
          </ul>
          <div class="content">
            <InputAccount v-show="isAccount" />
            <ScanCode v-show="!isAccount" />
          </div>

          <Coagent />
        </div>
      </div>
    </div>
    <!-- 底部版权 -->
    <FooterCopyRight />
  </div>
</template>

<script>
import LoginHeader from "@/components/LrHeader";
import FooterCopyRight from "@/components/Footer/FooterCopyRight";
import Coagent from "./Coagent";
import InputAccount from "./InputAccount";
import ScanCode from "./ScanCode";

export default {
  name: "Login",
  data() {
    return {
      isAccount: true,
    };
  },
  components: { LoginHeader, FooterCopyRight, Coagent, InputAccount, ScanCode },
  methods: {
    switchTab(index) {
      if (index == 2) {
        this.isAccount = false;
      } else {
        this.isAccount = true;
      }
    },
   
  },
};
</script>

<style scoped lang="less">
.login-wrap {
  height: 487px;
  background-color: #e93854;
  .login {
    width: 1200px;
    height: 487px;
    margin: 0 auto;
    background: url(./images/loginbg.png) no-repeat;
  }
  .loginform {
    width: 420px;
    height: 406px;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
    float: right;
    top: 40px;
    position: relative;
    padding: 20px;
    .tab {
      li {
        width: 50%;
        float: left;
        text-align: center;
        a {
          width: 100%;
          display: block;
          height: 50px;
          line-height: 50px;
          font-size: 20px;
          font-weight: 700;
          color: #333;
          border: 1px solid #ddd;
          box-sizing: border-box;
          text-decoration: none;
        }
        .current {
          border-bottom: none;
          border-top: 3px #28a3ef solid;
          color: #3498db;
        }
      }
    }
    .content {
      width: 380px;
      height: 265px;
      box-sizing: border-box;
      border: 1px solid #ddd;
      border-top: none;
      padding: 18px;
    }
  }
}
</style>